<?php
	if(isset($_SESSION["userID"]))
	{
		$userID = $_SESSION["userID"];
	}
	else if(isset($_COOKIE["ac"]))
	{
		$ac = mysql_real_escape_string($_COOKIE["ac"]);
		$queryUserID = mysql_query("SELECT ID FROM Users WHERE activationCode = '{$ac}'");
		$row = mysql_fetch_assoc($queryUserID);
		$userID = $row["ID"];
		
		$_SESSION["userID"] = $userID;
	}
	
	$userIP = $_SERVER["REMOTE_ADDR"];
	$host = $_SERVER["HTTP_HOST"];
?>